#ifndef _OTA_H_
#define _OTA_H_

#include "bsp_gpio.h"
#include "global_resources.h"
#include "EEPROM.h"
#include <string.h>


#define     FactoryInformationMaxSize           100
#define     FactoryInformationBaseAddr          0
#define     UpgradeRequestInformationAddr      101


class OTA {
private:
    BSP_GPIO    Triger;
    E2PROM      E2PR;

    bool Trig_Flag = false;

    char* UpgradeRequestInformation(void);
    void jump_to_bootloader(uint32_t bootloader_addr);
    void check_trig();
public:
    OTA();
    ~OTA();

    void run();
};


#endif
